<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="format-detection" content="address=no">
	
	<title>瑞州支付</title>
	<style type="text/css">
		*{margin:0;padding:0;}a{text-decoration:none;color:#000;}body{-webkit-text-size-adjust: none;font-family: "微软雅黑",Arial,Helvetica,sans-serif;color: #333;font-size: 14px;display: -webkit-box;	-webkit-box-orient: vertical;-webkit-box-align: stretch;line-height: 1.25em;background: #FFF;}
		ul{list-style-type: none;}li{display: inline-block;}img{border:none;}
		.ui-bg{border: 1px solid #456f9a /*{b-bar-border}*/;border-left:none;border-right:none;background: #5e87b0 /*{b-bar-background-color}*/;color: #fff /*{b-bar-color}*/;font-weight: bold;text-shadow: 0 /*{b-bar-shadow-x}*/ 1px /*{b-bar-shadow-y}*/ 1px /*{b-bar-shadow-radius}*/ #3e6790 /*{b-bar-shadow-color}*/;background-image: -webkit-gradient(linear, left top, left bottom, from( #6facd5 /*{b-bar-background-start}*/), to( #497bae /*{b-bar-background-end}*/));background-image: -webkit-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);background-image: -moz-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);background-image: -ms-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);background-image: -o-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);background-image: linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);}
		.ui-header{position:absolute;top:0;height:38px;width:100%;z-index: 1000;}
		.ui-header h1{-webkit-margin-before: 0.67em;-webkit-margin-after: 0.67em;-webkit-margin-start: 0px;-webkit-margin-end: 0px;font-weight: bold;min-height: 1.1em;text-align: center;font-size: 14px;display: block;margin: .6em 30% .8em;padding: 0;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;outline: 0 !important;}
		.back{position: absolute;left: 5px;top: 3px;}
		.close{position: absolute;right: 5px;top: 3px;}
		.ui-a{min-width: .75em;display: block;position: relative;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;zoom: 1;padding:5px;color:#FFF;}
		.ui-content{border-width: 0;overflow: visible;overflow-x: hidden;margin: 1em 0;padding:15px;}
		.pop_msg{text-align:center;position:absolute;left:45%;top:50%;overflow: visible;padding: 15px;-moz-border-radius: .6em /*{global-radii-blocks}*/;-webkit-border-radius: .6em /*{global-radii-blocks}*/;border-radius: .6em /*{global-radii-blocks}*/;border: 1px solid #f7c942 /*{e-body-border}*/;color: #222 /*{e-body-color}*/;background: #fff9df /*{e-body-background-color}*/;background-image: -webkit-gradient(linear, left top, left bottom, from( #fffadf /*{e-body-background-start}*/), to( #fff3a5 /*{e-body-background-end}*/));background-image: -webkit-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);background-image: -moz-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);background-image: -ms-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);background-image: -o-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);background-image: linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);-moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6);-webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6);box-shadow: 0px 0px 12px rgba(0,0,0,.6);}
		.ui-input{height:30px;border:none;box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);-moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);-webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);-webkit-appearance: none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;-ms-box-sizing: border-box;padding: .4em;margin: .5em 0;line-height: 1.4;font-size: 12px;display: block;width: 100%;outline: 0;-moz-border-radius: .6em /*{global-radii-blocks}*/;-webkit-border-radius: .6em /*{global-radii-blocks}*/;border-radius: .6em /*{global-radii-blocks}*/;}
		.ui-btn{cursor:pointer;margin-top:25px;height:34px;border:none;box-sizing: border-box;padding: .4em;margin: .5em 0;line-height: 1.4;font-size:14px;display: block;width: 100%;outline: 0;-moz-border-radius: .6em /*{global-radii-blocks}*/;-webkit-border-radius: .6em /*{global-radii-blocks}*/;border-radius: .6em /*{global-radii-blocks}*/;}
		.main_content{margin-top:30px;padding:10px 15px;}
		.main_content p{line-height: 24px;}.intro{color: #999;}
	</style>
	<script type="text/javascript">
		function $(id){return document.getElementById(id);}
		function openpop(str){
			var pop = document.getElementById(str);
			pop.style.display = "block";
		}
		function closepop(str){
			var pop = document.getElementById(str);
			pop.style.display = "none";
		}
		
		var loginStatusInfos = [];   
		loginStatusInfos[10000] = "登录成功";
		loginStatusInfos[10002] = "账户或密码错误";
		loginStatusInfos[10003] = "账号已存在";
		loginStatusInfos[10004] = "未知客户端错误";
		loginStatusInfos[10005] = "网络错误";
		
		//回调函数
		function RequestCallBack(statusInfo,statusCode,Id){
			if(statusInfo){//修改密码成功
				window.console.log('modified password success!');
			}else{//失败
				$("errMsg").style.display = 'block';
				$("errMsg").innerHTML = "<span style='color:red;'>修改密码失败,失败信息:"+loginStatusInfos[statusCode]+"</span>";
			}
		}
		
		window.onload = function(){
			
			try { //填充账号
				var userInfoJsonData = window.JsGameCenter.getAccountInfo();
				if(typeof(userInfoJsonData) !='undefined'){
					var getUserInfo = eval('('+userInfoJsonData+')');
					
					$userinfo_account = getUserInfo.AccountNo;
					$("account_no").value = $userinfo_account;
				}				
			} catch (e) {
				window.console.log('request userinfo error!');
			}
			
			
			
			$("uModify").onclick = function(){
				var password 		= $("password").value;
				var newpass 		= $("newpass").value;
				var newpassconfirm  = $("newpassconfirm").value;
				var account_no =  $("account_no").value;
				$("errMsg").style.display = "none";
				if(password.length == 0){
					openpop("pass_popup");
					setTimeout("closepop('pass_popup')",2000);
					return false;
				}
				if(newpass.length == 0){
					openpop("newpass_popup");
					setTimeout("closepop('newpass_popup')",2000);
					return false;
				}
				if(newpassconfirm.length == 0){
					openpop("newpassconfirm_popup");
					setTimeout("closepop('newpassconfirm_popup')",2000);
					return false;
				}
				
				if(newpass.length >0 && newpassconfirm.length > 0){
					if(newpass !== newpassconfirm){
						openpop("wrpass_popup");
						setTimeout("closepop('wrpass_popup')",2000);
						return false;
					}else{// 密码验证通过,请求修改
						try {
							window.JsGameCenter.modpwd(account_no,password,newpass);
							//showLoader("正在处理,请稍后...");
						} catch (e) {
							window.console.log('modify password failed!');
							RequestCallBack(0, 20004, account_no);
						}
					}
				}
				
			}
		}
	</script>
	</head>
	<body>
		<div class="ui-header ui-bg">
			<span class="back h_btn"><a class="ui-a" href="javascript:window.history.back();">返回</a></span>
			<h1>天天互娱 - 修改密码</h1>
			<span class="close h_btn"><a class="ui-a" href="javascript:window.JsGameCenter.closeWebView();">关闭</a></span>
		</div>
		<div class="ui-content">
			<div class="main_content">
				<form id="form" action="" method="post" id="form">
					<div class="bot">
						<p><label for="account_no">账号:</label></p>
    					<p><input type="text" onkeyup="value=value.replace(/[^\w\/]/ig,'')" name="account_no" id="account_no" value="" placeholder="输入账号"  class="ui-input" /></p>
    					<p><label for="password">密码:</label></p>
    					<p><input type="password" class="ui-input"  name="password" id="password"   value="" placeholder="输入原始密码" /></p>
    					<p><label for="newpass">新密码:</label></p>
    					<p><input maxlength="20"  placeholder="输入新密码" type="password"   name="newpass" id="newpass" value=""  class="ui-input" /></p>
    					<p><label for="newpassconfirm">重复密码:</label></p>
    					<p><input maxlength="20"  placeholder="重复新密码" type="password"   name="newpassconfirm" id="newpassconfirm" value=""  class="ui-input" /></p>
    					<br />
			          	<br />
			          	<p id="errMsg" style="display:none;"></p>
			          	<br />
						<p><input type="button" id='uModify' value="修 改"  class="ui-bg ui-btn" ></p>
						<br />
						<div class="notice" style="clear:both;">
							<p class="intro">温馨提示:</p>
			  				<p class="intro">如在操作过程中遇到任何问题,请拨打瑞州客服热线:4006-61-0061</p>
						</div>
					</div>
				</form>
			</div>
			<div class="pop" id="pass_popup" style="display:none;">
				<div class="pop_msg">
					<p>请输入您的密码</p>
				</div>
			</div>
			<div class="pop" id="newpass_popup" style="display:none;">
				<div class="pop_msg">
					<p>请输入您的新密码</p>
				</div>
			</div>
			<div class="pop" id="newpassconfirm_popup" style="display:none;">
				<div class="pop_msg">
					<p>请重复您的新密码</p>
				</div>
			</div>
			<div class="pop" id="wrpass_popup" style="display:none;">
				<div class="pop_msg">
					<p>两次输入的密码不一致</p>
				</div>
			</div>
		</div>
	</body>
</html>